/**
 * @file lv_toolbar.h
 *
 */

#ifndef LV_TOOLBAR_H
#define LV_TOOLBAR_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "../../../lvgl/src/core/lv_obj.h"

#if LV_USE_TOOLBAR

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

typedef enum {
    LV_TOOLBAR_ALIGN_RIGHT,   /**< left to right*/
    LV_TOOLBAR_ALIGN_LEFT,    /**< right to left*/
    LV_TOOLBAR_ALIGN_BOTTOM,  /**< top to bottom*/
    LV_TOOLBAR_ALIGN_TOP,    /**< bottom to top*/
} lv_toolbar_align_t;

LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_toolbar_class;
/**********************
 * GLOBAL PROTOTYPES
 **********************/

/**
 * Create a toolbar object
 * @param parent    pointer to an object, it will be the parent of the new toolbar
 * @param align     the growth direction of the toolbar
 * @return          pointer to the created toolbar
 */
lv_obj_t * lv_toolbar_create(lv_obj_t * parent);

/**
 * Used to update the arrangement, called after the child control is created
 * @param obj   pointer to a toolbar
 */
void lv_toolbar_update(lv_obj_t * toolbar);

/**
 * Set starting spacing
 * @param obj   pointer to a toolbar
 */
void lv_toolbar_set_align(lv_obj_t * toolbar, lv_toolbar_align_t align);

/**
 * Set starting spacing
 * @param obj   pointer to a toolbar
 */
void lv_toolbar_set_start_spacing(lv_obj_t * obj, uint8_t start_spacing);

/**
 * Set the distance between objects
 * @param obj   pointer to a toolbar
 */
void lv_toolbar_set_mid_spacing(lv_obj_t * obj, uint8_t mid_spacing);

/**
 * Add obj to a toolbar
 * @param toolbar  pointer to a toolbar
 * @param pos       location of obj
 * @return          pointer to the add obj
 */
lv_obj_t * lv_toolbar_add(lv_obj_t * toolbar, uint8_t pos);

/**
 * remove obj to a toolbar
 * @param toolbar      pointer to a toolbar, it will be the parent of the new label
 * @param pos        location of obj
 * @return          pointer to the created label
 */
void lv_toolbar_remove(lv_obj_t * toolbar, uint8_t pos);

/**
 * Get starting spacing
 * @param obj   pointer to a toolbar
 */
lv_toolbar_align_t lv_toolbar_get_align(const lv_obj_t * obj);

/**
 * Get starting spacing
 * @param obj   pointer to a toolbar
 */
uint8_t lv_toolbar_get_start_spacing(const lv_obj_t * obj);

/**
 * Get the distance between objects
 * @param obj   pointer to a toolbar
 */
uint8_t lv_toolbar_get_mid_spacing(const lv_obj_t * obj);

/**
 * get obj from a toolbar
 * @param toolbar   pointer to a toolbar
 * @param pos        location of obj
 * @return           pointer to the obj
 */
lv_obj_t * lv_toolbar_get_obj(lv_obj_t * toolbar, uint8_t pos);

/**
 * get obj from a toolbar
 * @param toolbar   pointer to a toolbar
 * @return           count to the obj
 */
uint32_t lv_toolbar_get_count(lv_obj_t * toolbar);

/**********************
 *      MACROS
 **********************/

#endif /*LV_USE_TOOLBAR*/

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif /*LV_TOOLBAR_H*/
